<script>
   var idremito;
    
    $(document).ready(function() {
        $("#window").kendoWindow({
        width: "300px",
        title: "",
        modal:true,
        visible:false,
        resizable: false
        });
    });
    
    function eliminarjs(id){
        var window=$("#window").data("kendoWindow");
        window.center();
        window.open();
        idremito=id;
    }
    
    function cancelar(){
        
        var window = $("#window").data("kendoWindow");
        window.close();
        
    }
</script>
<?php 
if($mensaje){?>
<script>
    alert('<?php echo $mensaje ?>');
</script>

<?php }?>
<div id="window"><p>¿Esta seguro que desea Borrar el Remito?</p>
    <a class="k-button"href="javascript:;" onclick="window.location.href=BASE_URL+'modificar_remito/editarRemito/'+idremito+'/0'">Aceptar</a>
    <a class="k-button"onclick="cancelar()">Cancelar</a>
</div>
<fieldset style="width: 700px">
  <h1>Listar Remitos</h1>
  <p>Lista todos las Remitos existentes</p>
<table id="tabla" cellspacing="0" style="margin-top: 20; ">
        
        <tr>
            <th class="elthini"><a class='bold' href="javascript:$('#tabla').sortTable({onCol: 1, keepRelationships: true, sortType: 'numeric'})" style="color:#333333;">Numero Remito</a></th>
            <th class="elth"><a class='bold' href="javascript:$('#tabla').sortTable({onCol: 2, keepRelationships: true})" style="color:#333333;">Fecha de Ingreso</a></th>
            <th class="elth"><a class='bold' href="javascript:$('#tabla').sortTable({onCol: 3, keepRelationships: true})" style="color:#333333;">Origen</a></th>
            <th class="elth"><a class='bold' href="javascript:$('#tabla').sortTable({onCol: 4, keepRelationships: true})" style="color:#333333;">Destino</a></th>
            <th class="elth">Editar</th>
            <th class="elthfin">Eliminar</th>
            
        </tr>
        
      <?php foreach ($lista_remitos as $i => $data) {?> 
        <tr>
            
        <td class="eltd">  <?php echo $data['id_remito'] ?></td>
        <td class="eltd">  <?php echo $data['fecha'] ?></td>
        <td class="eltd" >  <?php  echo $data['origen'] ?>  </td>  
        <td class="eltd" >  <?php  echo $data['destino'] ?> </td>
        <td class="eltd"><a href="<?php echo base_url().'modificar_remito/editarRemito/'.$data['id_remito'].'/1' ?>"  title="Editar"  alt="editar"  ><img src="<?php echo base_url() ?>css/images/edit.png" alt="" /></a></td>
       <td class="eltd"><a href="javascript:;" title="Eliminar"  onclick="eliminarjs('<?php echo $data['id_remito']?>')" alt="Eliminar"><img src="<?php echo base_url() ?>css/images/delete.png" alt="" /></a></td>
        </tr>
    
    <? } ?>
    </table>

</fieldset>